/*
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE.txt', which is part of this source code package.
 */
package me.idashu.attg.service;

import java.util.List;
import java.util.Map;

import me.idashu.attg.domain.OrderEntity;
import me.idashu.attg.persistence.OrderMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderService {
    @Autowired
    private OrderMapper orderMapper;

    public List<OrderEntity> getAllOrderEntity(Map<String, Object> map){
    	List<OrderEntity> listOrder = orderMapper.getAllOrderEntity(map);
    	return listOrder;
    }

    public int getCountAllOrder(Map<String, Object> map){
    	int count = orderMapper.getCountAllOrder(map);
    	return count;
    }
    
    public OrderEntity getOneOrderEntity(int orderId){
    	OrderEntity orderEntity = orderMapper.getOneOrderEntity(orderId);
    	return orderEntity;
    }
    
    public List<OrderEntity> getMemberOrder(int memberId){
    	List<OrderEntity> listOrder = orderMapper.getMemberOrder(memberId);
    	return listOrder;
    }
    
    public List<OrderEntity> getOrderEntityByMemberId(int memberId){
    	List<OrderEntity> listOrder = orderMapper.getOrderEntityByMemberId(memberId);
    	return listOrder;
    }
    
    public void updateOrderStatu(OrderEntity orderEntity){
    	orderMapper.updateOrderStatu(orderEntity);
    }
    
    public void insertOrderEntity(OrderEntity orderEntity){
    	orderMapper.insertOrderEntity(orderEntity);
    }
    
}
